package cn.anlab.anappframe.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import cn.anlab.anappframe.BaseActivity;
import cn.anlab.anappframe.R;
import cn.anlab.anappframe.demo.activity.HomeDemoActivity;
import cn.anlab.anappframe.system.CoreApplication;

public class SplashActivity extends BaseActivity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		waitTask.start();
	}
	
	public Thread waitTask = new Thread() {
		public void run() {
			try {
				Thread.sleep(300);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			handler.sendEmptyMessage(1);
		};
	};
	
	
	
	private Handler handler = new Handler() {
		public void handleMessage(android.os.Message msg) {
			CoreApplication.initNetConnection();
			//跳转到首页
			Intent intent = new Intent();
			intent.setClass(SplashActivity.this, HomeDemoActivity.class);
			startActivity(intent);
			finish();
		};
	};
	

}
